package wiktionary.to.xml.full.jpa;

// Generated Oct 28, 2013 11:11:01 AM by Hibernate Tools 3.4.0.CR1

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Sense generated by hbm2java
 */
@Entity
@Table(name = "sense")
public class Sense implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
    private Integer id;
    private WordEntry wordEntry;
    private String dataField;
    private Set<Example> examples = new LinkedHashSet<Example>(0);

    public Sense() {
    }

    public Sense(WordEntry wordEntry) {
        this.wordEntry = wordEntry;
    }

    public Sense(WordEntry wordEntry, String dataField, Set<Example> examples) {
        this.wordEntry = wordEntry;
        this.dataField = dataField;
        this.examples = examples;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "wordentry_id", nullable = false)
	public WordEntry getWordEntry() {
		return this.wordEntry;
	}

	public void setWordEntry(WordEntry wordEntry) {
		this.wordEntry = wordEntry;
	}

    @Column(name = "dataField", length = 4000)
    public String getDataField() {
        return this.dataField;
    }

    public void setDataField(String dataField) {
        this.dataField = dataField;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "sense")
    public Set<Example> getExamples() {
        return this.examples;
    }

    public void setExamples(Set<Example> examples) {
        this.examples = examples;
    }

}
